package com.zealfi.wk.trace;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by kuan at 2018-05-15 下午 5:46
 */
@RestController
@SpringCloudApplication
public class Trace2Application {
    private static final Logger logger = LoggerFactory.getLogger(Trace2Application.class);

    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }

    @RequestMapping("trace-2")
    public String trace() {
        logger.info("==== call trace-2 ====");

        return "Trace";
    }


    public static void main(String[] args) {
        SpringApplication.run(Trace2Application.class, args);
    }
}
